From: robxnano <91250-robxnano@users.noreply.gitlab.gnome.org> Date: Sat, 26 Nov 2022 14:09:40 +0000 (+0000) Subject: filechoosernativewin32: Set default extension X-Git-Tag: archive/raspbian/3.24.39-1+rpi1~1^2~65^2~1^2~27^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c1aec7f100f4d83ee22d84bde4f8ba4c3cf6c144;p=gtk%2B3.0.git filechoosernativewin32: Set default extension Setting the default extension before a filter is selected allows the IFileDialog to automatically change the extension when the filter is changed. See: https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifiledialog-setdefaultextension --- diff --git a/gtk/gtkfilechoosernativewin32.c b/gtk/gtkfilechoosernativewin32.c index bec7ca4be3..d2f1769210 100644 --- a/gtk/gtkfilechoosernativewin32.c +++ b/gtk/gtkfilechoosernativewin32.c @@ -610,6 +610,10 @@ filechooser_win32_thread (gpointer _data) if (FAILED (hr)) g_warning_hr ("Can't set file types", hr); + hr = IFileDialog_SetDefaultExtension (pfd, L""); + if (FAILED (hr)) + g_warning_hr ("Can't set default extension", hr); + if (data->self->current_filter) { GSList *filters = gtk_file_chooser_list_filters (GTK_FILE_CHOOSER (data->self));